<template>
  <tl-ref-tree v-model="valueBridge" :initDisplayData.sync="initDisplayDataBridge" refTitle="会议类型选择" v-bind="inputProps" v-on="{ confirm }" queryTreeUrl="/meet/typeManage/queryTreeList?isAddRoot=false" queryDataUrl="/meet/typeManage/list?1=1" treeQueryKey="qry_parentid"></tl-ref-tree>
</template>

<script>
export default {
  name: 'TlMeetType',
  data() {
    return {
      valueBridge: undefined,
      initDisplayDataBridge: ''
    }
  },
  props: {
    value: {
      default: '',
      type: [String, Number]
    },
    initDisplayData: {
      default: '',
      type: String
    }
  },
  computed: {
    inputProps() {
      return this.$attrs
    }
  },
  methods: {
    confirm(datas) {
      this.$emit('confirm', datas)
    }
  },
  created() {
    this.valueBridge = this.value
    this.initDisplayDataBridge = this.initDisplayData
  },
  watch: {
    value(newVal, oldVal) {
      this.valueBridge = newVal
    },
    valueBridge(newVal, oldVal) {
      this.$emit('input', newVal)
    },
    initDisplayData(newVal, oldVal) {
      this.initDisplayDataBridge = newVal
    },
    initDisplayDataBridge(newVal, oldVal) {
      this.$emit('update:initDisplayData', newVal)
    }
  }
}
</script>

<style></style>
